package com.hxd.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hxd.base.BaseController;
import com.hxd.common.Result;
import com.hxd.entity.SysUser;
import com.hxd.pojo.SysUserVO;
import com.hxd.service.SysUserService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
    * 用户表 前端控制器
    * </p>
 *
 * @author zhoujw
 * @since 2019-12-12
 * @version v1.0
 */
@Api(tags="用户表")
@RestController
@RequestMapping("/sys-user")
public class SysUserController extends BaseController<SysUser, SysUserVO> {
	
	@Autowired
	private SysUserService service; 
	
	@PostMapping("/register")
	@ApiOperation(value = "用户注册")
	public Result save(@RequestBody SysUserVO sysUserVO) {
		service.save(sysUserVO);
		return Result.success();
	}

	@PostMapping("/update")
	@ApiOperation(value = "用户信息修改")
	public Result update(@RequestBody SysUserVO sysUserVO) {
		service.update(sysUserVO);
		return Result.success();
	}
	
}
